package com.yqg.protection.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yqg.protection.cover.BindingConverter;
import com.yqg.protection.cover.LocalDateTimeConverter;
import com.yqg.protection.cover.SIMStateConverter;
import com.yqg.protection.cover.SimBindingTypeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * SIM_input_store 实体类
 *
 * @author zxf
 * @since 2024-01-01
 */
@Getter
@Setter
@TableName("SIM_input_store")
@ApiModel(value = "SimInputStore对象", description = "")
public class SimInputStore implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "ID", index = 0)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelProperty(value = "SIM卡号", index = 1)
    private String simId;

    @ExcelProperty(value = "组织ID", index = 2)
    private Long organization;

    @ExcelProperty(value = "单位ID", index = 3)
    @ApiModelProperty("单位ID")
    private Long clientId;

    @ExcelProperty(value = "单位名称", index = 4)
    @TableField(exist = false)
    @ApiModelProperty("单位名称")
    private String clientName;

    @ExcelProperty(value = "入库时间", index = 5, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime inputTime;

    @ExcelIgnore
    @ApiModelProperty("0,正常 1，删除")
    private Integer isDelete;

    @ExcelProperty(value = "状态", index = 6, converter = SIMStateConverter.class)
    private String state;

    @ExcelProperty(value = "厂家", index = 7)
    private String manufactor;

    @ExcelProperty(value = "厂家电话", index = 8)
    private String manufactorPhone;

    @ExcelProperty(value = "激活日期", index = 9, converter = LocalDateTimeConverter.class)
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;

    @ExcelProperty(value = "有效日期", index = 10, converter = LocalDateTimeConverter.class)
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime time;

    @ExcelProperty(value = "套餐", index = 11)
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String dataPackage;

    @ExcelProperty(value = "是否绑定设备(未绑定,已绑定)", index = 12, converter = BindingConverter.class)
    @ApiModelProperty("0未绑定设备 ，1已绑定设备")
    private Integer deviceBindingEquipment;

    @ExcelProperty(value = "设备类型(信息传输装置,监控设备)", index = 13, converter = SimBindingTypeConverter.class)
    @ApiModelProperty("0信息传输装置 ，1监控设备")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Integer deviceBindingType;

    @ExcelProperty(value = "绑定设备ID", index = 14)
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long equipmentInputStoreId;

    @ExcelProperty(value = "绑定设备号", index = 15)
    @TableField(exist = false)
    private String equipmentId;

    @ExcelProperty(value = "操作人ID", index = 16)
    private Long operatorId;

    @ExcelProperty(value = "操作人", index = 17)
    @TableField(exist = false)
    private String operatorName;

    @ExcelProperty(value = "组织", index = 18)
    @TableField(exist = false)
    private String organizationName;

    @ApiModelProperty("是否过期")
    @TableField(exist = false)
    private String isExpire;
}
